{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "4b4a18e3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Addition Examples: 12\n"
     ]
    }
   ],
   "source": [
    "a, b = 7, 5\n",
    "sum_result = a + b\n",
    "print(f'Addition Examples: {sum_result}')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "eabe9790",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Subtraction example: 2\n"
     ]
    }
   ],
   "source": [
    "diff_result = a - b\n",
    "print(f'Subtraction example: {diff_result}')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "b695268e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Multiplication example: 35\n"
     ]
    }
   ],
   "source": [
    "product_result = a * b\n",
    "print(f'Multiplication example: {product_result}')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "9ff1c6e1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Division example: quotient is 1, remainder is 2\n"
     ]
    }
   ],
   "source": [
    "\n",
    "def euclidean_division(a, b):\n",
    "    quotient, remainder = divmod(a, b)\n",
    "    if remainder < 0:\n",
    "        # Adjust the remainder to ensure non-negativity\n",
    "        remainder += abs(b)\n",
    "        # Adjust the quotient so that the equation still holds\n",
    "        quotient += 1\n",
    "    return quotient, remainder\n",
    "\n",
    "quotient, remainder = euclidean_division(a, b)\n",
    "print(f'Division example: quotient is {quotient}, remainder is {remainder}')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "947c925c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-1\n",
      "-2\n"
     ]
    }
   ],
   "source": [
    "print(3 % -2) # 3 - (3//(-2) * -2) = -1\n",
    "print(3 // -2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a1997880",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
